.class public Lcom/zuiapps/suite/utils/image/mix/ImageMixUtil;
.super Ljava/lang/Object;
.source "ImageMixUtil.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/zuiapps/suite/utils/image/mix/ImageMixUtil$MixCallback;
    }
.end annotation


# direct methods
.method public constructor <init>()V
    .registers 1

    .prologue
    .line 23
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 24
    return-void
.end method

.method public static createTextPaint(Landroid/widget/TextView;IZFFF)Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;
    .registers 10
    .param p0, "textView"    # Landroid/widget/TextView;
    .param p1, "textColor"    # I
    .param p2, "hasShadow"    # Z
    .param p3, "lineSpaceMultiplier"    # F
    .param p4, "translateX"    # F
    .param p5, "translateY"    # F

    .prologue
    const/4 v3, 0x0

    .line 159
    new-instance v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;

    invoke-direct {v0}, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;-><init>()V

    .line 160
    .local v0, "textElement":Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;
    invoke-virtual {p0}, Landroid/widget/TextView;->getTextSize()F

    move-result v1

    iput v1, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->textSize:F

    .line 161
    invoke-virtual {p0}, Landroid/widget/TextView;->getTypeface()Landroid/graphics/Typeface;

    move-result-object v1

    iput-object v1, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->typeFace:Landroid/graphics/Typeface;

    .line 162
    iput-boolean p2, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->hasShadow:Z

    .line 163
    iput p1, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->textColor:I

    .line 165
    invoke-virtual {p0}, Landroid/widget/TextView;->getText()Ljava/lang/CharSequence;

    move-result-object v1

    invoke-interface {v1}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object v1

    iput-object v1, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->text:Ljava/lang/String;

    .line 166
    iput p4, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->translateX:F

    .line 167
    iput p5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->translateY:F

    .line 168
    invoke-virtual {p0}, Landroid/widget/TextView;->getWidth()I

    move-result v1

    iput v1, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->textWidth:I

    .line 169
    invoke-virtual {p0}, Landroid/widget/TextView;->getHeight()I

    move-result v1

    iput v1, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->textHeight:I

    .line 170
    iput p3, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->textSpaceMulti:F

    .line 171
    const/4 v1, 0x0

    iput v1, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->textSpaceAdd:F

    .line 172
    iget-object v1, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->text:Ljava/lang/String;

    iget v2, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->textSize:F

    invoke-static {v1, v2, v3}, Lcom/zuiapps/suite/utils/font/FontUtil;->getFontHeight(Ljava/lang/String;FLandroid/graphics/Typeface;)I

    move-result v1

    iput v1, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->fontHeight:I

    .line 173
    iget-object v1, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->text:Ljava/lang/String;

    iget v2, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->textSize:F

    invoke-static {v1, v2, v3}, Lcom/zuiapps/suite/utils/font/FontUtil;->getFontWidth(Ljava/lang/String;FLandroid/graphics/Typeface;)I

    move-result v1

    iput v1, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->fontWidth:I

    .line 175
    return-object v0
.end method

.method public static mix(Landroid/content/Context;Landroid/graphics/Bitmap;Ljava/util/List;Ljava/lang/String;Lcom/zuiapps/suite/utils/image/mix/ImageMixUtil$MixCallback;)V
    .registers 37
    .param p0, "context"    # Landroid/content/Context;
    .param p1, "photo"    # Landroid/graphics/Bitmap;
    .param p3, "filePath"    # Ljava/lang/String;
    .param p4, "mixCallback"    # Lcom/zuiapps/suite/utils/image/mix/ImageMixUtil$MixCallback;
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "NewApi"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Landroid/graphics/Bitmap;",
            "Ljava/util/List",
            "<",
            "Lcom/zuiapps/suite/utils/image/mix/MixElement;",
            ">;",
            "Ljava/lang/String;",
            "Lcom/zuiapps/suite/utils/image/mix/ImageMixUtil$MixCallback;",
            ")V"
        }
    .end annotation

    .prologue
    .line 30
    .local p2, "mixElements":Ljava/util/List;, "Ljava/util/List<Lcom/zuiapps/suite/utils/image/mix/MixElement;>;"
    if-eqz p1, :cond_8

    invoke-virtual/range {p1 .. p1}, Landroid/graphics/Bitmap;->isRecycled()Z

    move-result v5

    if-eqz v5, :cond_12

    .line 31
    :cond_8
    if-eqz p4, :cond_11

    .line 32
    const-string v5, ""

    move-object/from16 v0, p4

    invoke-interface {v0, v5}, Lcom/zuiapps/suite/utils/image/mix/ImageMixUtil$MixCallback;->postCallback(Ljava/lang/String;)V

    .line 143
    :cond_11
    :goto_11
    return-void

    .line 38
    :cond_12
    :try_start_12
    invoke-virtual/range {p1 .. p1}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v27

    .local v27, "width":I
    invoke-virtual/range {p1 .. p1}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v15

    .line 39
    .local v15, "hight":I
    sget-object v5, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    move/from16 v0, v27

    invoke-static {v0, v15, v5}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v19

    .line 41
    .local v19, "pic":Landroid/graphics/Bitmap;
    new-instance v12, Landroid/graphics/Canvas;

    move-object/from16 v0, v19

    invoke-direct {v12, v0}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    .line 43
    .local v12, "canvas":Landroid/graphics/Canvas;
    new-instance v18, Landroid/graphics/Paint;

    invoke-direct/range {v18 .. v18}, Landroid/graphics/Paint;-><init>()V

    .line 44
    .local v18, "photoPaint":Landroid/graphics/Paint;
    const/4 v5, 0x1

    move-object/from16 v0, v18

    invoke-virtual {v0, v5}, Landroid/graphics/Paint;->setDither(Z)V

    .line 45
    const/4 v5, 0x1

    move-object/from16 v0, v18

    invoke-virtual {v0, v5}, Landroid/graphics/Paint;->setFilterBitmap(Z)V

    .line 47
    new-instance v20, Landroid/graphics/Rect;

    const/4 v5, 0x0

    const/4 v7, 0x0

    invoke-virtual/range {p1 .. p1}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v8

    invoke-virtual/range {p1 .. p1}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v9

    move-object/from16 v0, v20

    invoke-direct {v0, v5, v7, v8, v9}, Landroid/graphics/Rect;-><init>(IIII)V

    .line 48
    .local v20, "src":Landroid/graphics/Rect;
    new-instance v13, Landroid/graphics/Rect;

    const/4 v5, 0x0

    const/4 v7, 0x0

    move/from16 v0, v27

    invoke-direct {v13, v5, v7, v0, v15}, Landroid/graphics/Rect;-><init>(IIII)V

    .line 49
    .local v13, "dst":Landroid/graphics/Rect;
    move-object/from16 v0, p1

    move-object/from16 v1, v20

    move-object/from16 v2, v18

    invoke-virtual {v12, v0, v1, v13, v2}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Paint;)V

    .line 51
    invoke-interface/range {p2 .. p2}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v28

    :cond_61
    :goto_61
    invoke-interface/range {v28 .. v28}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-eqz v5, :cond_7f

    invoke-interface/range {v28 .. v28}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v17

    check-cast v17, Lcom/zuiapps/suite/utils/image/mix/MixElement;

    .line 52
    .local v17, "mixElement":Lcom/zuiapps/suite/utils/image/mix/MixElement;
    move-object/from16 v0, v17

    instance-of v5, v0, Lcom/zuiapps/suite/utils/image/mix/ViewElement;

    if-eqz v5, :cond_d3

    .line 53
    move-object/from16 v0, v17

    check-cast v0, Lcom/zuiapps/suite/utils/image/mix/ViewElement;

    move-object/from16 v26, v0

    .line 55
    .local v26, "viewElement":Lcom/zuiapps/suite/utils/image/mix/ViewElement;
    invoke-virtual/range {v26 .. v26}, Lcom/zuiapps/suite/utils/image/mix/ViewElement;->getView()Landroid/view/View;

    move-result-object v25

    .line 56
    .local v25, "view":Landroid/view/View;
    if-nez v25, :cond_aa

    .line 104
    .end local v17    # "mixElement":Lcom/zuiapps/suite/utils/image/mix/MixElement;
    .end local v25    # "view":Landroid/view/View;
    .end local v26    # "viewElement":Lcom/zuiapps/suite/utils/image/mix/ViewElement;
    :cond_7f
    const/16 v5, 0x1f

    invoke-virtual {v12, v5}, Landroid/graphics/Canvas;->save(I)I

    .line 105
    invoke-virtual {v12}, Landroid/graphics/Canvas;->restore()V

    .line 108
    new-instance v5, Lcom/zuiapps/suite/utils/image/mix/ImageMixUtil$1;

    move-object/from16 v0, p3

    move-object/from16 v1, v19

    move-object/from16 v2, p4

    move-object/from16 v3, p1

    invoke-direct {v5, v0, v1, v2, v3}, Lcom/zuiapps/suite/utils/image/mix/ImageMixUtil$1;-><init>(Ljava/lang/String;Landroid/graphics/Bitmap;Lcom/zuiapps/suite/utils/image/mix/ImageMixUtil$MixCallback;Landroid/graphics/Bitmap;)V

    .line 130
    invoke-virtual {v5}, Lcom/zuiapps/suite/utils/image/mix/ImageMixUtil$1;->start()V
    :try_end_97
    .catch Ljava/lang/OutOfMemoryError; {:try_start_12 .. :try_end_97} :catch_99
    .catch Ljava/lang/Throwable; {:try_start_12 .. :try_end_97} :catch_c5

    goto/16 :goto_11

    .line 131
    .end local v12    # "canvas":Landroid/graphics/Canvas;
    .end local v13    # "dst":Landroid/graphics/Rect;
    .end local v15    # "hight":I
    .end local v18    # "photoPaint":Landroid/graphics/Paint;
    .end local v19    # "pic":Landroid/graphics/Bitmap;
    .end local v20    # "src":Landroid/graphics/Rect;
    .end local v27    # "width":I
    :catch_99
    move-exception v14

    .line 132
    .local v14, "e":Ljava/lang/OutOfMemoryError;
    invoke-static {}, Ljava/lang/System;->gc()V

    .line 133
    invoke-static {}, Ljava/lang/System;->runFinalization()V

    .line 134
    if-eqz p4, :cond_11

    .line 135
    const/4 v5, 0x0

    move-object/from16 v0, p4

    invoke-interface {v0, v5}, Lcom/zuiapps/suite/utils/image/mix/ImageMixUtil$MixCallback;->postCallback(Ljava/lang/String;)V

    goto/16 :goto_11

    .line 60
    .end local v14    # "e":Ljava/lang/OutOfMemoryError;
    .restart local v12    # "canvas":Landroid/graphics/Canvas;
    .restart local v13    # "dst":Landroid/graphics/Rect;
    .restart local v15    # "hight":I
    .restart local v17    # "mixElement":Lcom/zuiapps/suite/utils/image/mix/MixElement;
    .restart local v18    # "photoPaint":Landroid/graphics/Paint;
    .restart local v19    # "pic":Landroid/graphics/Bitmap;
    .restart local v20    # "src":Landroid/graphics/Rect;
    .restart local v25    # "view":Landroid/view/View;
    .restart local v26    # "viewElement":Lcom/zuiapps/suite/utils/image/mix/ViewElement;
    .restart local v27    # "width":I
    :cond_aa
    :try_start_aa
    invoke-virtual {v12}, Landroid/graphics/Canvas;->save()I

    .line 62
    invoke-virtual/range {v26 .. v26}, Lcom/zuiapps/suite/utils/image/mix/ViewElement;->getStartX()F

    move-result v21

    .line 63
    .local v21, "startX":F
    invoke-virtual/range {v26 .. v26}, Lcom/zuiapps/suite/utils/image/mix/ViewElement;->getStartY()F

    move-result v22

    .line 64
    .local v22, "startY":F
    move/from16 v0, v21

    move/from16 v1, v22

    invoke-virtual {v12, v0, v1}, Landroid/graphics/Canvas;->translate(FF)V

    .line 65
    move-object/from16 v0, v25

    invoke-virtual {v0, v12}, Landroid/view/View;->draw(Landroid/graphics/Canvas;)V

    .line 67
    invoke-virtual {v12}, Landroid/graphics/Canvas;->restore()V
    :try_end_c4
    .catch Ljava/lang/OutOfMemoryError; {:try_start_aa .. :try_end_c4} :catch_99
    .catch Ljava/lang/Throwable; {:try_start_aa .. :try_end_c4} :catch_c5

    goto :goto_61

    .line 137
    .end local v12    # "canvas":Landroid/graphics/Canvas;
    .end local v13    # "dst":Landroid/graphics/Rect;
    .end local v15    # "hight":I
    .end local v17    # "mixElement":Lcom/zuiapps/suite/utils/image/mix/MixElement;
    .end local v18    # "photoPaint":Landroid/graphics/Paint;
    .end local v19    # "pic":Landroid/graphics/Bitmap;
    .end local v20    # "src":Landroid/graphics/Rect;
    .end local v21    # "startX":F
    .end local v22    # "startY":F
    .end local v25    # "view":Landroid/view/View;
    .end local v26    # "viewElement":Lcom/zuiapps/suite/utils/image/mix/ViewElement;
    .end local v27    # "width":I
    :catch_c5
    move-exception v23

    .line 138
    .local v23, "t":Ljava/lang/Throwable;
    invoke-virtual/range {v23 .. v23}, Ljava/lang/Throwable;->printStackTrace()V

    .line 139
    if-eqz p4, :cond_11

    .line 140
    const/4 v5, 0x0

    move-object/from16 v0, p4

    invoke-interface {v0, v5}, Lcom/zuiapps/suite/utils/image/mix/ImageMixUtil$MixCallback;->postCallback(Ljava/lang/String;)V

    goto/16 :goto_11

    .line 69
    .end local v23    # "t":Ljava/lang/Throwable;
    .restart local v12    # "canvas":Landroid/graphics/Canvas;
    .restart local v13    # "dst":Landroid/graphics/Rect;
    .restart local v15    # "hight":I
    .restart local v17    # "mixElement":Lcom/zuiapps/suite/utils/image/mix/MixElement;
    .restart local v18    # "photoPaint":Landroid/graphics/Paint;
    .restart local v19    # "pic":Landroid/graphics/Bitmap;
    .restart local v20    # "src":Landroid/graphics/Rect;
    .restart local v27    # "width":I
    :cond_d3
    :try_start_d3
    move-object/from16 v0, v17

    instance-of v5, v0, Lcom/zuiapps/suite/utils/image/mix/ImageElement;

    if-eqz v5, :cond_f4

    .line 70
    move-object/from16 v0, v17

    check-cast v0, Lcom/zuiapps/suite/utils/image/mix/ImageElement;

    move-object/from16 v16, v0

    .line 71
    .local v16, "imageElement":Lcom/zuiapps/suite/utils/image/mix/ImageElement;
    move-object/from16 v0, v16

    iget-object v5, v0, Lcom/zuiapps/suite/utils/image/mix/ImageElement;->bitmap:Landroid/graphics/Bitmap;

    move-object/from16 v0, v16

    iget v7, v0, Lcom/zuiapps/suite/utils/image/mix/ImageElement;->x:I

    int-to-float v7, v7

    move-object/from16 v0, v16

    iget v8, v0, Lcom/zuiapps/suite/utils/image/mix/ImageElement;->y:I

    int-to-float v8, v8

    move-object/from16 v0, v18

    invoke-virtual {v12, v5, v7, v8, v0}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    goto/16 :goto_61

    .line 72
    .end local v16    # "imageElement":Lcom/zuiapps/suite/utils/image/mix/ImageElement;
    :cond_f4
    move-object/from16 v0, v17

    instance-of v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;

    if-eqz v5, :cond_61

    .line 73
    move-object/from16 v0, v17

    check-cast v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;

    move-object/from16 v24, v0

    .line 74
    .local v24, "textElement":Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;
    new-instance v6, Landroid/text/TextPaint;

    const/16 v5, 0x101

    invoke-direct {v6, v5}, Landroid/text/TextPaint;-><init>(I)V

    .line 75
    .local v6, "textPaint":Landroid/text/TextPaint;
    const/4 v5, 0x1

    invoke-virtual {v6, v5}, Landroid/text/TextPaint;->setAntiAlias(Z)V

    .line 76
    move-object/from16 v0, v24

    iget v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->textSize:F

    invoke-virtual {v6, v5}, Landroid/text/TextPaint;->setTextSize(F)V

    .line 77
    move-object/from16 v0, v24

    iget-object v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->typeFace:Landroid/graphics/Typeface;

    if-eqz v5, :cond_11f

    .line 78
    move-object/from16 v0, v24

    iget-object v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->typeFace:Landroid/graphics/Typeface;

    invoke-virtual {v6, v5}, Landroid/text/TextPaint;->setTypeface(Landroid/graphics/Typeface;)Landroid/graphics/Typeface;

    .line 80
    :cond_11f
    move-object/from16 v0, v24

    iget v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->textColor:I

    invoke-virtual {v6, v5}, Landroid/text/TextPaint;->setColor(I)V

    .line 81
    move-object/from16 v0, v24

    iget-boolean v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->hasShadow:Z

    if-eqz v5, :cond_13f

    .line 82
    move-object/from16 v0, v24

    iget v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->shadowRadius:F

    move-object/from16 v0, v24

    iget v7, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->shadowDx:F

    move-object/from16 v0, v24

    iget v8, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->shadowDy:F

    move-object/from16 v0, v24

    iget v9, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->shadowColor:I

    invoke-virtual {v6, v5, v7, v8, v9}, Landroid/text/TextPaint;->setShadowLayer(FFFI)V

    .line 84
    :cond_13f
    new-instance v4, Landroid/text/StaticLayout;

    move-object/from16 v0, v24

    iget-object v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->text:Ljava/lang/String;

    move-object/from16 v0, v24

    iget v7, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->fontWidth:I

    move-object/from16 v0, v24

    iget-object v8, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->align:Landroid/text/Layout$Alignment;

    move-object/from16 v0, v24

    iget v9, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->textSpaceMulti:F

    move-object/from16 v0, v24

    iget v10, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->textSpaceAdd:F

    const/4 v11, 0x1

    invoke-direct/range {v4 .. v11}, Landroid/text/StaticLayout;-><init>(Ljava/lang/CharSequence;Landroid/text/TextPaint;ILandroid/text/Layout$Alignment;FFZ)V

    .line 86
    .local v4, "layout":Landroid/text/StaticLayout;
    invoke-virtual {v12}, Landroid/graphics/Canvas;->save()I

    .line 87
    move-object/from16 v0, v24

    iget v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->translateX:F

    move-object/from16 v0, v24

    iget v7, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->translateY:F

    invoke-virtual {v12, v5, v7}, Landroid/graphics/Canvas;->translate(FF)V

    .line 88
    invoke-virtual {v4, v12}, Landroid/text/StaticLayout;->draw(Landroid/graphics/Canvas;)V

    .line 89
    move-object/from16 v0, v24

    iget-object v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->nextBottomTextElement:Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;

    if-eqz v5, :cond_183

    .line 90
    move-object/from16 v0, v24

    iget-object v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->nextBottomTextElement:Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;

    iget v7, v5, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->translateY:F

    invoke-virtual {v4}, Landroid/text/StaticLayout;->getHeight()I

    move-result v8

    int-to-float v8, v8

    move-object/from16 v0, v24

    iget v9, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->translateY:F

    add-float/2addr v8, v9

    add-float/2addr v7, v8

    iput v7, v5, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->translateY:F

    .line 92
    :cond_183
    move-object/from16 v0, v24

    iget-object v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->nextRightTextElement:Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;

    if-eqz v5, :cond_1a6

    .line 93
    move-object/from16 v0, v24

    iget-object v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->nextRightTextElement:Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;

    move-object/from16 v0, v24

    iget v7, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->translateY:F

    iput v7, v5, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->translateY:F

    .line 94
    move-object/from16 v0, v24

    iget-object v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->nextRightTextElement:Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;

    iget v7, v5, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->translateX:F

    invoke-virtual {v4}, Landroid/text/StaticLayout;->getWidth()I

    move-result v8

    int-to-float v8, v8

    move-object/from16 v0, v24

    iget v9, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->translateX:F

    add-float/2addr v8, v9

    add-float/2addr v7, v8

    iput v7, v5, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->translateX:F

    .line 96
    :cond_1a6
    move-object/from16 v0, v24

    iget-object v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->nextRightImgElement:Lcom/zuiapps/suite/utils/image/mix/ImageElement;

    if-eqz v5, :cond_1d6

    .line 97
    move-object/from16 v0, v24

    iget-object v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->nextRightImgElement:Lcom/zuiapps/suite/utils/image/mix/ImageElement;

    iget v7, v5, Lcom/zuiapps/suite/utils/image/mix/ImageElement;->x:I

    invoke-virtual {v4}, Landroid/text/StaticLayout;->getWidth()I

    move-result v8

    int-to-float v8, v8

    move-object/from16 v0, v24

    iget v9, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->translateX:F

    add-float/2addr v8, v9

    float-to-int v8, v8

    add-int/2addr v7, v8

    iput v7, v5, Lcom/zuiapps/suite/utils/image/mix/ImageElement;->x:I

    .line 98
    move-object/from16 v0, v24

    iget-object v5, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->nextRightImgElement:Lcom/zuiapps/suite/utils/image/mix/ImageElement;

    move-object/from16 v0, v24

    iget v7, v0, Lcom/zuiapps/suite/utils/image/mix/CustomTextElement;->translateY:F

    float-to-double v8, v7

    invoke-virtual {v4}, Landroid/text/StaticLayout;->getHeight()I

    move-result v7

    int-to-double v10, v7

    const-wide/high16 v30, 0x4008000000000000L

    div-double v10, v10, v30

    add-double/2addr v8, v10

    double-to-int v7, v8

    iput v7, v5, Lcom/zuiapps/suite/utils/image/mix/ImageElement;->y:I

    .line 100
    :cond_1d6
    invoke-virtual {v12}, Landroid/graphics/Canvas;->restore()V
    :try_end_1d9
    .catch Ljava/lang/OutOfMemoryError; {:try_start_d3 .. :try_end_1d9} :catch_99
    .catch Ljava/lang/Throwable; {:try_start_d3 .. :try_end_1d9} :catch_c5

    goto/16 :goto_61
.end method

.method public static saveBitmap(Landroid/graphics/Bitmap;Ljava/lang/String;)V
    .registers 7
    .param p0, "bitmap"    # Landroid/graphics/Bitmap;
    .param p1, "filePath"    # Ljava/lang/String;
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "NewApi"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 147
    new-instance v1, Ljava/io/FileOutputStream;

    invoke-direct {v1, p1}, Ljava/io/FileOutputStream;-><init>(Ljava/lang/String;)V

    .line 148
    .local v1, "fos":Ljava/io/FileOutputStream;
    new-instance v2, Ljava/io/ByteArrayOutputStream;

    invoke-direct {v2}, Ljava/io/ByteArrayOutputStream;-><init>()V

    .line 150
    .local v2, "stream":Ljava/io/ByteArrayOutputStream;
    sget-object v3, Landroid/graphics/Bitmap$CompressFormat;->JPEG:Landroid/graphics/Bitmap$CompressFormat;

    const/16 v4, 0x64

    invoke-virtual {p0, v3, v4, v2}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z

    .line 151
    invoke-virtual {v2}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object v0

    .line 153
    .local v0, "bytes":[B
    invoke-virtual {v1, v0}, Ljava/io/FileOutputStream;->write([B)V

    .line 154
    invoke-virtual {v1}, Ljava/io/FileOutputStream;->close()V

    .line 155
    return-void
.end method
